import sqlite3
import numpy as np
import pandas as pd

with sqlite3.connect("example.db") as conn:
    cursor = conn.cursor()        
    df = pd.read_sql(
            """
            select name from sqlite_master 
            where type = 'table' 
            and name like '%stock_board_industry_info_ths_%' 
            and name != 'stock_board_industry_info_ths_2'
            """,conn)
    for item in df['name']:
        industry_info = pd.read_sql(f"select * from {item}",conn)
        new_row = pd.DataFrame({
            "项目":["table"],
            "值":[f"{item}"]
            })
        industry_info = pd.concat([industry_info,new_row])
        cursor.execute(f"""
                       insert into stock_board_industry_info_ths_2 
                       {tuple(industry_info['项目'])} 
                       values 
                       {tuple(industry_info['值'])}
                       """)
    conn.commit()
